package com.gary.springcloud.controller;

import com.gary.springcloud.entity.CommonResult;
import com.gary.springcloud.entity.Payment;
import com.gary.springcloud.service.IPaymentFeignService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author pengrui
 * @date 2021/1/10 - 14:07
 */
@RestController
public class OrderController {

    @Resource
    private IPaymentFeignService paymentService;

    @GetMapping("/consumer/payment/query/{id}")
    public CommonResult<Payment> queryById(@PathVariable("id") Long id) {
        return paymentService.queryById(id);
    }

    @GetMapping("/consumer/payment/feign/timeout")
    public CommonResult<String> timeout() {
        return paymentService.timeout();
    }
}
